package top.hiai.service;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;

import top.hiai.model.Link;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top,开发者：黄康权
* @Introduction 类的介绍
*/
public class LinkService {
	
	private Link dao = new Link().dao();
	
	/**
	  * 获取友情链接
	  * @return
	  */
   public List<Link> getArticleHotList() {
	   return dao.find(" select * from t_link ORDER BY lid DESC ");
   }
   /**
    * 后台显示友情链接列表，可以分页显示
    * @param pageNumber
    * @param pageSize
    * @return
    */
	public Page<Link> paginate(int pageNumber, int pageSize) {
		return dao.paginate(pageNumber, pageSize, "select * ", "from  t_link order by sort ASC");
	}
    /**
     * 根据友情链接ID获取
     * @param uid
     * @return
     */
	public Link findById(int lid) {
		return dao.findById(lid);
	}
    /**
     * 删除友情链接
     * @param lid
     */
    public void deleteById(int lid) {
        dao.deleteById(lid);
    }
}
